package com.service.medical.Impl;

import com.comm.R;
import com.comm.vo.DrugBillVo;
import com.entity.DrugBill;
import com.entity.DrugOrder;
import com.entity.Supplier;
import com.mapper.medical.PurchaseMapper;
import com.service.medical.PurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PurchaseServiceImpl implements PurchaseService {

    @Resource
    private PurchaseMapper purchaseMapper;



    @Override
    public R findAllSupName() {
            R r = new R();
            try {
                List<String> supNameList = purchaseMapper.findAllSupName();
                System.out.println(supNameList.size());
                int count = supNameList.size();
                if(count>0){
                    r.setCode(200);
                    r.setData(supNameList);
                }else {
                    r.setCode(500);
                    r.setData("查询失败");
                }
            }catch (Exception e){
                e.printStackTrace();
                r.setCode(500);
                r.setMsg("系统开小差了，请联系管理员！");
            }
            return r;
        }

//    @Override
//    public R SubmitCheck(DrugBillVo drugBillVo) {
//            R r = new R();
//            drugBillVo.getDrugBill();
//            drugBillVo.getDrugOrder();


//            try{
//
//        if(count>0){
//            r.setCode(200);
//            r.setData(supNameList);
//        }else {
//            r.setCode(500);
//            r.setData("删除失败");
//        }
//    }catch (Exception e){
//        e.printStackTrace();
//        r.setCode(500);
//        r.setMsg("系统开小差了，请联系管理员！");
//    }
//
//    return r;
//    }


}
